---
title: "Create Pipeline"
api: "POST /v1/pipeline"
description: "Create a new named pipeline with custom chunking and refinement steps"
---

Create a reusable pipeline configuration that can be executed multiple times with different inputs.

## Examples

<CodeGroup>

```python Python
from chonkie.cloud import Pipeline

pipeline = Pipeline(
    slug="my-rag-pipeline",
    description="Pipeline for RAG processing"
).chunk_with("recursive", chunk_size=512).refine_with("overlap", context_size=64)

# Pipeline is auto-saved on first run
chunks = pipeline.run(text="Your document text here")
```

```typescript JavaScript
import { Pipeline } from '@chonkiejs/cloud';

const pipeline = new Pipeline({
  slug: 'my-rag-pipeline',
  description: 'Pipeline for RAG processing',
});

pipeline
  .chunkWith('recursive', { chunk_size: 512 })
  .refineWith('overlap', { context_size: 64 });

// Pipeline is auto-saved on first run
const chunks = await pipeline.run({ text: 'Your document text here' });
```

```bash cURL
curl -X POST https://api.chonkie.ai/v1/pipeline \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "slug": "my-rag-pipeline",
    "description": "Pipeline for RAG processing",
    "steps": [
      {"type": "chunk", "component": "recursive", "chunk_size": 512},
      {"type": "refine", "component": "overlap", "context_size": 64}
    ]
  }'
```

</CodeGroup>

## Request

<ParamField path="slug" type="string" required>
  Unique identifier for the pipeline. Must contain only lowercase letters, numbers, dashes, and underscores.
</ParamField>

<ParamField path="description" type="string">
  Optional description of the pipeline's purpose.
</ParamField>

<ParamField path="steps" type="array" required>
  Array of pipeline step configurations. Must include at least one `chunk` step.

  Each step object contains:
  - `type`: Step type (`process`, `chunk`, or `refine`)
  - `component`: Component name (e.g., `recursive`, `overlap`, `embeddings`)
  - Additional parameters specific to the component
</ParamField>

## Response

<ResponseField name="id" type="string">
  Unique identifier for the pipeline.
</ResponseField>

<ResponseField name="slug" type="string">
  The pipeline slug.
</ResponseField>

<ResponseField name="description" type="string">
  Pipeline description.
</ResponseField>

<ResponseField name="organization_slug" type="string">
  Organization that owns the pipeline.
</ResponseField>

<ResponseField name="steps" type="array">
  Array of pipeline step configurations.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of creation.
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 timestamp of last update.
</ResponseField>

## Errors

| Status | Description |
|--------|-------------|
| 409 | Pipeline with this slug already exists |
| 422 | Invalid slug format or missing required fields |
